<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file="includes/sessao.asp" -->
<html>
<head>
<title>Solic</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!-- #include file="includes/styles.css" -->
<body>
<table width="780" border="0" cellspacing="0" cellpadding="1"><tr><td>
  <br>
  <br>
  <br>
  <br>
<div align="center"> <strong><font color="#C991BF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Altera&ccedil;&atilde;o 
  de Senha</font></strong><br>
</div>
<% If request("senha1") = "" and request("senha2") = "" then %>
<form action="senha.asp" method="post" name="frmLogin" id="frmLogin">
  <table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="1" height="22" bgcolor="#552C73"></td>
      <td width="149" height="22" bgcolor="#C991BF"> <div align="center"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">NOVA 
          SENHA </font></div></td>
      <td width="1" height="22"></td>
      <td width="148" height="22" bgcolor="#C991BF"> <div align="center"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">CONFIRMAR 
          SENHA</font></div></td>
      <td width="1" height="22" bgcolor="#552C73"></td>
    </tr>
    <tr valign="middle"> 
      <td width="1" height="40" bgcolor="#552C73"></td>
      <td width="149" height="40" align="center"> <input name="senha1" type="password" id="editSenha1" style="color : #552C73; background : #FFFFFF; border-top : 1px solid; border-bottom : 1px solid; border-left : 1px solid; border-right : 1px solid; border-color : #6498C0; font-family : Verdana,tahoma,Arial; font-size : 9px; font-align" size="20"></td>
      <td width="1" height="40" bgcolor="#552C73"></td>
      <td width="148" height="40" align="center"> <input name="senha2" type="password" id="editSenha2" style="color : #552C73; background : #FFFFFF; border-top : 1px solid; border-bottom : 1px solid; border-left : 1px solid; border-right : 1px solid; border-color : #6498C0; font-family : Verdana,tahoma,Arial; font-size : 9px; font-align" size="20"></td>
      <td width="1" height="40" bgcolor="#552C73"></td>
    </tr>
    <tr> 
      <td width="1" height="1" bgcolor="#552C73"></td>
      <td width="149" height="1" bgcolor="#552C73"></td>
      <td width="1" height="1" bgcolor="#552C73"></td>
      <td width="148" height="1" bgcolor="#552C73"></td>
      <td width="1" height="1" bgcolor="#552C73"></td>
    </tr>
    <tr> 
      <td width="1" height="19" bgcolor="#552C73"></td>
      <td height="19" colspan="3" align="center" bgcolor="#552C73" onClick="document.frmLogin.submit();" onMouseOver="m_over(this,'#999999');" onMouseOut="m_out(this,'#552C73');"> 
        <font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">ALTERAR</font></td>
      <td width="1" height="19" bgcolor="#552C73"></td>
    </tr>
  </table>
</form>
<% else
	If request("senha1") <> request("senha2") then
%>
	<br>
	<table width="250" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr> 
    	<td height="30" bgcolor="#C991BF"> 
			<div align="center"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">ATEN&Ccedil;&Atilde;O</font></div></td>
	</tr>
	<tr> 
    	<td height="1"></td>
	</tr>
	<tr> 
		<td height="50"> 
			<div align="center"><font color="#552C73" size="2" face="Verdana, Arial, Helvetica, sans-serif">Os 
        dois campos DEVEM ser <br>
        preenchidos com valores iguais!</font></div></td>
	</tr>
	<tr> 
    	<td height="1"></td>
	</tr>
	<tr> 
    	<td height="20" bgcolor="#552C73" onClick="location.href='senha.asp';" onMouseOut="m_out(this,'#552C73');" onMouseOver="m_over(this,'#999999');"> 
			<div align="center"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">VOLTAR</font></div></td>
	</tr>
	</table>
<%	else
		set conn = server.CreateObject("adodb.connection")
		strConn = "driver={SQL Server}; database=bd_pessoal; uid=intranet; pwd=pobreza; server=black"
		conn.open strConn
		conn.execute("update tb_colaborador set tx_senha=convert(varbinary(255), pwdencrypt('" & request("senha1") &_
		             "')) where cod_colaborador = " & session("eUsuario"))
		conn.close
		set conn=nothing
%>
<script>
       alert('Senha alterada com sucesso');
	   location.href='principal.asp';
</script>
<%
	end if
	end if
%>
</td></tr></table>
</body>
</html>
